import styles from '../styles.less';
import {Button} from 'antd';
import {TagOutlined} from '@ant-design/icons';
import {useAccess, Access} from 'umi';

const Opera = (props) => {

  const {setTags} = props.data;
  const access = useAccess();

  function tags(e) {
    e.preventDefault();
    setTags({
      visible: true,
      title: '标签管理',
      data: undefined,
    });
  }

  return (
    <div className={styles.myOperaAction}>
      <div className={styles.leftContent}>
        <Access accessible={access?.user_tag_list ?? false}>
          <Button type='primary' ghost onClick={tags} icon={<TagOutlined/>}>
            标签管理
          </Button>
        </Access>
      </div>
    </div>
  );
};

export default Opera;
